package RMIClient;

import interfase.HelloRegistryFacade;

import java.rmi.NotBoundException;
import java.rmi.RemoteException;
import java.rmi.registry.LocateRegistry;
import java.rmi.registry.Registry;

/**
 * 先启动Service在启动Client
 * @author 24270
 */
public class RegistryClient {
    public static void main(String[] args) throws RemoteException, NotBoundException {
        Registry registry = LocateRegistry.getRegistry(2021);
        HelloRegistryFacade hello = (HelloRegistryFacade) registry.lookup("LiZiKang");
        String response = hello.helloWorld("123123");
        System.out.println("=======> " + response + " <=======");
    }
}
